<html>
<head>
    <title>Keep In Touch - Newsletter: Address Lists</title>
    <script language="JavaScript1.2" src='<TMPL_VAR name=APP_PATH>/js/prototype.js' /></script>
    <script language="JavaScript1.2" src='<TMPL_VAR name=APP_PATH>/js/scriptaculous.js?load=builder,effects' /></script>
    <script language="JavaScript1.2" src='<TMPL_VAR name=APP_PATH>/js/modalbox.js' /></script>

    <link rel="stylesheet" href="<TMPL_VAR name=APP_PATH>/css/style.css" type="text/css">
    <link rel="stylesheet" href="<TMPL_VAR name=APP_PATH>/js/modalbox.css" type="text/css">
</head>
<body background="<TMPL_VAR name=APP_PATH>/images/main_bg_gradient_blue.gif">

<div id=loginbox style="height:500px;">
    <TMPL_INCLUDE name=loginbox.html>
</div>

<center>
    <a onClick="ForgotPassword();">Forgot Password</a> |
    <a onClick="Register('show_register_form');">Register New Account</a> |
    <a href=>Login</a>

<div style="width:55%;"><TMPL_INCLUDE name=../footer.html></div>
</center>

<script>

URL	= "Login.pl";

function Login()
{
    PARAMS	= "u=" + $('u').value + "&p=" + $('p').value + "&action=do_login";

    new Ajax.Updater ('auth_result', URL,
        {
            method: 'get', 
            parameters: PARAMS,
            onLoading: ShowLoading,
            //  onComplete: ShowResult,
            //  onSuccess: LoadApp,
        });
}

function Register(action) 
{
    PARAMS	= "action=" + action;

    if (action == 'do_register') {
        PARAMS = PARAMS + "&f_name=" + $('f_name').value + "&l_name=" + $('l_name').value + "&p=" + $('p').value + "&repeat_p=" + $('repeat_p').value + "&u=" + $('u').value ;
        new Ajax.Updater ('auth_result', URL, {method: 'get', parameters: PARAMS, onLoading: ShowLoading});
    }
    else {
        new Ajax.Updater ('loginbox', URL, {method: 'get', parameters: PARAMS, onLoading: ShowLoading,});
        // Modalbox.show();
    }
}

function ForgotPassword() {
	PARAMS	= "u=" + $('u').value + "&action=forgot_password";

	new Ajax.Updater ('loginbox', URL, {method: 'get', parameters: PARAMS,});
}

function ShowLoginStatus() {
	$('loginbox').innerHTML = 'logging in ...';
}

function ShowLoading() {
	$('auth_result').innerHTML = 'Loading...'
}

function LoadApp() {
	location.href = '<TMPL_VAR name=APP_PATH>/';
}
</script>

<style>
table.login_table {
    margin-top: 100px;
    width:      60%;
}

    .login_table td, th {
        font-size: 16px;
    }

    .login_table input[type=password], input[type=text] {
        font-size: 20px;
        width: 100%;
        height: 28pt;
        padding:4px;
        vertical-align: middle;
        color: darkblue;
        font-family:arial;
        font-weight:bold;
        font-style:none;
    }

        .login_table input[type=button] {
            font-size: 16px;
        }
</style>